package com.xcity.pomelo.response;

import java.util.List;

import com.xcity.db.entity.Player;
import com.xcity.game.adventure.model.ActionTarget;
import com.xcity.pomelo.response.AdventurePlayResponse.Target;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class AdventureStealResponse extends Response {
	
	public int index;
	public byte result; // 0-未猜中, 1-猜中
	public List<Result> list;
	public Target nextStealTarget; // 下一次偷取目标
	
	public static class Result {
		public long id;
		public String name;
		public String icon;
		public long gold;
		public Result(Player player, long gold) {
			this.id = player.getId();
			this.name = player.getName();
			this.icon = player.getIcon();
			this.gold = gold;
		}
	}

	public AdventureStealResponse(int serial, int index, boolean isRight, List<Result> list) {
		this(serial, index, isRight, list, null);
	}
	
	public AdventureStealResponse(int serial, int index, boolean isRight, List<Result> list, ActionTarget nextStealTarget) {
		super(serial);
		this.index = index;
		this.result = (byte) (isRight ? 1 : 0);
		this.list = list;
		if (nextStealTarget != null) {
			this.nextStealTarget = new Target(nextStealTarget);
		}
	}

}
